package com.darkplanet.management.controller;

import com.darkplanet.management.dao.IModelDao;
import com.darkplanet.management.dao.IRequirementimpl;
import com.darkplanet.management.domain.Requirement;
import com.darkplanet.management.service.ModelService;
import com.darkplanet.management.service.RequirementService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/ModelAddServlet")
public class ModelAddServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ModelService modelService = new ModelService();
        String project_id = request.getParameter("project_id");
        String requirement_id = request.getParameter("requirement_id");
        RequirementService requirementService = new RequirementService  ();
        String model_name = request.getParameter("model_name");
        String priority = request.getParameter("priority");
        String simple_desc = request.getParameter("simple_desc");
        String complplex_desc = request.getParameter("complplex_desc");
        String remark = request.getParameter("remark");
        int i = Integer.parseInt(requirement_id);
        modelService.addModelUser(i,model_name,priority,simple_desc,complplex_desc,remark);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
